/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * IngresoComputadoras.java
 *
 * Created on 24/11/2011, 02:14:42 AM
 */
package presentacion;

/**
 *
 * @author hernaldo
 */
public class IngresoComputadoras extends javax.swing.JFrame {

    Control control;
    
    /** Creates new form IngresoComputadoras */
    public IngresoComputadoras() {
        initComponents();
        this.mensajeAyuda();
        this.setLocationRelativeTo(null);
    }
    
    /**
     * 
     * @param c
     */
    public void getControl(Control c){
        this.control = c;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Tipo = new javax.swing.ButtonGroup();
        txt_modelo = new javax.swing.JTextField();
        txt_numeroserie = new javax.swing.JTextField();
        rb_comprada = new javax.swing.JRadioButton();
        lb_modelo = new javax.swing.JLabel();
        lb_numeroserie = new javax.swing.JLabel();
        lb_año = new javax.swing.JLabel();
        txt_marca = new javax.swing.JTextField();
        lb_marca = new javax.swing.JLabel();
        rb_donada = new javax.swing.JRadioButton();
        btn_agregar = new javax.swing.JButton();
        btn_limpiar = new javax.swing.JButton();
        txt_año = new javax.swing.JTextField();
        btn_Cancelar = new javax.swing.JButton();

        setTitle("Manejo Computadoras");
        setName("Ingreso de Computadora"); // NOI18N

        Tipo.add(rb_comprada);
        rb_comprada.setFont(new java.awt.Font("Tahoma", 1, 11));
        rb_comprada.setText("Comprada");

        lb_modelo.setFont(new java.awt.Font("Tahoma", 1, 11));
        lb_modelo.setText("Modelo");

        lb_numeroserie.setFont(new java.awt.Font("Tahoma", 1, 11));
        lb_numeroserie.setText("Número de Serie:");

        lb_año.setFont(new java.awt.Font("Tahoma", 1, 11));
        lb_año.setText("Año de Ingreso:");

        lb_marca.setFont(new java.awt.Font("Tahoma", 1, 11));
        lb_marca.setText("Marca:");

        Tipo.add(rb_donada);
        rb_donada.setFont(new java.awt.Font("Tahoma", 1, 11));
        rb_donada.setText("Doñada");

        btn_agregar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentacion/imagenes/Insertar.gif"))); // NOI18N
        btn_agregar.setText("Agregar");
        btn_agregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_agregarActionPerformed(evt);
            }
        });

        btn_limpiar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentacion/imagenes/Limpiar.png"))); // NOI18N
        btn_limpiar.setText("Limpiar");
        btn_limpiar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_limpiarActionPerformed(evt);
            }
        });

        btn_Cancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentacion/imagenes/Cancelar.png"))); // NOI18N
        btn_Cancelar.setText("Cancelar");
        btn_Cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btn_limpiar)
                .addGap(24, 24, 24)
                .addComponent(btn_Cancelar)
                .addGap(31, 31, 31)
                .addComponent(btn_agregar)
                .addContainerGap(21, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(53, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lb_numeroserie)
                            .addComponent(lb_año)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(txt_año, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(txt_numeroserie, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(44, 44, 44)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lb_modelo)
                            .addComponent(lb_marca)
                            .addComponent(txt_modelo, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txt_marca, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addComponent(rb_comprada)
                        .addGap(62, 62, 62)
                        .addComponent(rb_donada)))
                .addGap(40, 40, 40))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lb_numeroserie)
                        .addGap(5, 5, 5)
                        .addComponent(txt_numeroserie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lb_año)
                        .addGap(17, 17, 17)
                        .addComponent(txt_año, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(81, 81, 81)
                        .addComponent(txt_marca, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lb_modelo)
                        .addGap(5, 5, 5)
                        .addComponent(txt_modelo, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lb_marca)))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb_donada)
                    .addComponent(rb_comprada))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_limpiar)
                    .addComponent(btn_Cancelar)
                    .addComponent(btn_agregar))
                .addGap(43, 43, 43))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_agregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_agregarActionPerformed
       
}//GEN-LAST:event_btn_agregarActionPerformed

    private void btn_limpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_limpiarActionPerformed
        this.limpiar();
    }//GEN-LAST:event_btn_limpiarActionPerformed

private void btn_CancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CancelarActionPerformed

        this.txt_marca.setText("");
        this.txt_modelo.setText("");
        this.txt_año.setText("");
        this.txt_numeroserie.setText("");
        this.Tipo.clearSelection();
        setVisible(false);
}//GEN-LAST:event_btn_CancelarActionPerformed
/**
 * 
 */
public void limpiar(){
        this.txt_marca.setText("");
        this.txt_modelo.setText("");
        this.txt_año.setText("");
        this.txt_numeroserie.setText("");
        this.Tipo.clearSelection();
    }
   
   private void mensajeAyuda(){
       this.txt_numeroserie.setToolTipText("Numero identificador de la computadora");
       this.txt_modelo.setToolTipText("Ingrese modelo de la computadora");
       this.txt_marca.setToolTipText("Ingrese marca de la computadora");
       this.txt_año.setToolTipText("Ingrese el año");
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup Tipo;
    private javax.swing.JButton btn_Cancelar;
    private javax.swing.JButton btn_agregar;
    private javax.swing.JButton btn_limpiar;
    private javax.swing.JLabel lb_año;
    private javax.swing.JLabel lb_marca;
    private javax.swing.JLabel lb_modelo;
    private javax.swing.JLabel lb_numeroserie;
    private javax.swing.JRadioButton rb_comprada;
    private javax.swing.JRadioButton rb_donada;
    private javax.swing.JTextField txt_año;
    private javax.swing.JTextField txt_marca;
    private javax.swing.JTextField txt_modelo;
    private javax.swing.JTextField txt_numeroserie;
    // End of variables declaration//GEN-END:variables
}
